package com.yugao.fintech.antelope.base.log;

import com.yugao.fintech.antelope.base.log.event.OperateLogListener;
import com.yugao.fintech.antelope.system.SystemApi;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;


@EnableAsync
@RequiredArgsConstructor
@ConditionalOnWebApplication
@Configuration(proxyBeanMethods = false)
@Import({OperateLogAspect.class})
public class LogAutoConfiguration {

    @Bean
    public OperateLogListener sysOperateLogListener(SystemApi systemApi) {
        return new OperateLogListener(systemApi);
    }
}
